﻿/// <reference path="../../../extjs/ext-all-debug.js" />
Ext.define('yzmh.view.chapter.List', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.chapterlist',
    closable: true,
    title: '',
    store: 'Chapters',
    loadMask: true,
    columnLines: true,
    forceFit: true,
    sortableColumns: false,
    viewConfig: {
        trackOver: false,
        stripeRows: true,
        plugins: {
            ptype: 'gridviewdragdrop'
        }
    },
    tbar: [
        { xtype: 'tbfill' }, { action: 'htmlall', text: '生成全部章节', icon: 'extjs/icons/html_go.png' }, "-", { action: 'html', text: '生成', icon: 'extjs/icons/html_go.png' }, "-", { action: 'add', text: '新增', icon: 'extjs/icons/book_add.png', menu: [] }, "-", { action: 'download', text: '下载', icon: 'extjs/icons/picture_save.png' }, "-", { action: 'rename', text: '重命名', icon: 'extjs/icons/image_edit.png' }, "-", { action: 'editmulti', text: '批量修改', icon: 'extjs/icons/book_edit.png' }, "-", { action: 'refresh', text: '刷新', icon: 'extjs/icons/book_next.png' }, "-", { action: 'delete', text: '删除', icon: 'extjs/icons/book_delete.png' }
    ],
    selType: 'rowmodel',
    selModel: Ext.create("Ext.selection.RowModel", {
        mode: 'MULTI'
    }),
    columns: [
        { header: '编号', dataIndex: 'id', align: 'center', width: 50 },
        {
            header: '名称', dataIndex: 'zjmc', width: 100
        },
        { header: '图片路径', dataIndex: 'tpadd', flex: 0 },
        { header: '数量', dataIndex: 'tps', align: 'center', width: 50 },
        { header: '更新时间', dataIndex: 'time', align: 'center', renderer: Ext.util.Format.dateRenderer('Y-m-d h:i') },
        { header: '点击', dataIndex: 'hits', align: 'center', width: 50 },
        {
            header: '图片', dataIndex: 'tpurl', align: 'center', width: 200, renderer: function (value, cell) {
                cell.tdAttr = 'data-qtip="' + value + '"';
                return value;
            }
        },{
            action: 'view',
            xtype: 'actioncolumn',
            width: 40,
            header: '预览',
            align: 'center',
            icon: 'extjs/icons/book_link.png'
        }, {
            action: 'edit',
            xtype: 'actioncolumn',
            width: 40,
            header: '编辑',
            align: 'center',
            icon: 'extjs/icons/book_edit.png'
        }
    ],
    bbar: {
        xtype:'statusbar',
        text: '就绪',
        iconCls: 'x-status-valid',
        items: [
            {
                xtype: 'progressbar',
                text: '正在初始化...',
                width: 200,
                hidden:true
            }
        ]
    }
});


